The present invention relates to shared memory, and more specifically, to managing shared data objects to provide visibility to shared memory between separate processes running the same processor.
Java is an example of a platform independent programming language that is used to build enterprise-level applications. With WebSphere Application Server for z/Series, a logical application server can be made up of multiple Java virtual machines (JVMs), each executing in a different address space. These address spaces are called servant regions (SRs), each containing one JVM. If a SR abends, another SR can take over the incoming requests in a multiple SR environment.
WebSphere Application server for z/Series distributed environment concepts to create and manage application servers. Each application server includes multiple address spaces that represent a single logical application server. At a minimum, one application server includes one control region (CR) and one SR. Additional SRs can be added, with the number of SRs limited by the physical memory available on the system. The main responsibility of the CR is to handle the incoming connections from the clients and dispatch the request to the SRs. The SR is the component of an application server where the actual application runs and transactions are processed in a JVM.
Currently in WebSphere for z/Series, a request is received from a client application by the CR and passed to the SR for processing. Upon processing of the request, a response is sent back to the CR for output to the client application. During the course of this processing several copies of data need to be made. When information is passed from the CR to the SR, a physical copy is made to allow visibility of the request to the SR. Similarly, on the response path the response is copied from the SR to the CR in order to allow the CR to have visibility to the response.
An embodiment includes a system for sharing data between computer processes. The system includes a processor configured to implement a method that includes executing a plurality of independent processes on an application server, the processes including a first process and a second process. A shared memory utilized by the plurality of independent processes is provided. A single copy of the data and metadata are stored in the shared memory. The metadata includes an address of the data. The first process initiates the storing of the data in the shared memory. An address of the metadata is transferred from the first process to the second process to notify the second process about the data. The second process determines the address of the shared memory by reading the metadata. The data in the shared memory is accessed by the second process.
A further embodiment is a computer program product for sharing data between computer processes. The computer program product includes a tangible storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method. The method includes executing a plurality of independent processes on an application server, the processes including a first process and a second process. A shared memory utilized by the plurality of independent processes is provided. A single copy of the data and metadata are stored in the shared memory. The metadata includes an address of the data. The first process initiates the storing of the data in the shared memory. An address of the metadata is transferred from the first process to the second process to notify the second process about the data. The second process determines the address of the shared memory by reading the metadata. The data in the shared memory is accessed by the second process.
Additional features and advantages are realized through the techniques of the present invention.
Other embodiments and aspects of the invention are described in detail herein and are considered a part of the claimed invention. For a better understanding of the invention with the advantages and the features, refer to the description and to the drawings.